package com.doyens.gmall.item.controller;

import com.doyens.gmall.common.result.Result;
import com.doyens.gmall.item.service.ItemService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Classname:ItemApiController
 * PackageName:com.doyens.gmall.item
 *
 * @Author:uyijk
 * @Create:2023/7/28 11:27
 * @Version: 1.0
 */
@RestController
@RequestMapping("api/item")
@Api(tags = "商品详情")
public class ItemApiController {
    @Autowired
    private ItemService itemService;
    @GetMapping("{skuId}")
    public Result getItem(@PathVariable("skuId")Long skuId){
        Map<String, Object> map = itemService.getBySkuId(skuId);
        return Result.ok(map);
    }
}
